import request from './request'
import { PageInfoType, UserType } from './type'
// 获取pet分页信息
export function getUsersApi(pageInfo: PageInfoType) {
  return request({
    method: 'get',
    url: `/users?pageSize=${pageInfo.pageSize}&currentPage=${pageInfo.currentPage}`,
  })
}

export function addUserApi(user: UserType) {
  return request({
    method: 'post',
    url: '/users/new',
    data: {
      user
    }
  })
}

export function delUserApi(id: number) {
  return request({
    method: 'get',
    url: `/users/del?id=${id}`
  })
}

export function updateUserApi(user: UserType) {
  return request({
    method: 'post',
    url: '/users/update',
    data: {
      user
    }
  })
}
